<!DOCTYPE html>
<html>
<head>
    <title>新增购房人登记</title>
<#include "../common/common.ftl"/>
</head>
<body>
<div class="layui-fluid">
    <blockquote class="layui-elem-quote layui-bg-white">
        协议信息：【姓名：<span class="jmdf-color-red">${(contract.name)!}</span>】【协议编号：<span
            class="jmdf-color-red">${(contract.contractCode)!}</span>】
    </blockquote>
    <div class="layui-row  layui-col-space10">
        <div class="layui-col-xs12">
            <div class="layui-card">
                <form class="layui-form" action="">
                    <input type="hidden" name="contractId" value="${(contract.id)!}"/>
                    <input type="hidden" name="buyHousePersonId" value="${(buyHousePerson.id)!}"/>

                    <div class="layui-form-item jmdf-color-red" style="text-align: center">
                       请录入单个人名信息！！！
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">产权人姓名：</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" id="name" lay-verify="required"
                                   value="${(buyHousePerson.name)!}" autocomplete="off" placeholder="必填项"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">产权人身份证号：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                                   lay-verify="required" name="idCard"
                                   value="${(buyHousePerson.idCard)!}"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">产权人联系电话：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                                   lay-verify="required" name="tel" value="${(buyHousePerson.tel)!}"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">关系：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                                   lay-verify="required" name="relation" value="${(buyHousePerson.relation)!}"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">取得类型：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" autocomplete="off" placeholder="必填项"
                                   lay-verify="required" name="type" value="${(buyHousePerson.type)!}"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">备注：</label>
                        <div class="layui-input-block">
                            <textarea class="layui-textarea" name="memo">${(buyHousePerson.memo)!}</textarea>
                        </div>
                    </div>
                    <button style="display: none;" class="layui-btn" id="submitBtn" name="submitBtn" lay-submit=""
                            lay-filter="submit">立即提交
                    </button>
                </form>
            </div>
        </div>
    </div>
</div>
<script src="/layui/layui.js" charset="utf-8"></script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['form', 'jquery', 'jmdf', 'verify'], function () {
        var form = layui.form, $ = layui.jquery, jmdf = layui.jmdf, verify = layui.verify,
                parentIndex = parent.layer.getFrameIndex(window.name);

        form.on('submit(submit)', function (data) {
            $.ajax({
                url: "buyHousePersonSave"
                , type: "post"
                , data: data.field
                , success: function (data) {
                    if (data.code == "0001") {
                        layer.alert("配置成功！")
                        parent.loadData();
                        parent.layer.close(parentIndex);
                    } else {
                        layer.msg(data.message, {anim: 6, icon: 2});
                    }
                }
            });
            return false;
        });
    });
</script>
</body>
</html>